Platform Explorer / Nuxeo Platform 2021.51

Component org.nuxeo.ecm.platform.audit.PageProviderservice.es.contrib

Requirements

Resolution Order

289
The resolution order represents the order in which this component has been resolved by the Nuxeo Runtime framework.
You can influence this order by adding "require" tags in your component declaration, to make sure it is resolved after another component.

Contributions

XML Source

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.platform.audit.PageProviderservice.es.contrib">

  <require>org.nuxeo.ecm.platform.audit.PageProviderservice.contrib</require>
  <require>org.nuxeo.admin.pageproviders</require>

  <extension target="org.nuxeo.ecm.platform.query.api.PageProviderService"
    point="providers">

    <genericPageProvider name="EVENTS_VIEW" class="org.nuxeo.elasticsearch.audit.pageprovider.ESAuditPageProvider">
      <property name="coreSession">#{documentManager}</property>
      <property name="generateUIComments">false</property>
      <whereClause docType="BasicAuditSearch">
        <predicate parameter="eventDate" operator="BETWEEN">
          <field schema="basicauditsearch" name="startDate" />
          <field schema="basicauditsearch" name="endDate" />
        </predicate>
        <predicate parameter="category" operator="=">
          <field schema="basicauditsearch" name="eventCategory" />
        </predicate>
        <predicate parameter="eventId" operator="IN">
          <field schema="basicauditsearch" name="eventIds" />
        </predicate>
        <predicate parameter="principalName" operator="=">
          <field schema="basicauditsearch" name="principalName" />
        </predicate>
      </whereClause>
      <sort column="eventDate" ascending="false" />
      <pageSize>10</pageSize>
      <maxPageSize>1000</maxPageSize>
    </genericPageProvider>

    <genericPageProvider name="DOCUMENT_HISTORY_PROVIDER_OLD"
      class="org.nuxeo.elasticsearch.audit.pageprovider.ESAuditPageProvider">
      <whereClause docType="BasicAuditSearch">
        <fixedPart>
            {
		        "bool" : {
		          "must" : {
		            "match" : {
		              "docUUID" : {
		                "query" : "?"
		              }
		            }
		          }
		        }
			  }
        </fixedPart>
        <predicate parameter="eventDate" operator="BETWEEN">
          <field schema="basicauditsearch" name="startDate" />
          <field schema="basicauditsearch" name="endDate" />
        </predicate>
        <predicate parameter="category" operator="IN">
          <field schema="basicauditsearch" name="eventCategories" />
        </predicate>
        <predicate parameter="eventId" operator="IN">
          <field schema="basicauditsearch" name="eventIds" />
        </predicate>
        <predicate parameter="principalName" operator="IN">
          <field schema="basicauditsearch" name="principalNames" />
        </predicate>
      </whereClause>
      <sort column="id" ascending="true" />
      <pageSize>5</pageSize>
    </genericPageProvider>


    <genericPageProvider name="DOCUMENT_HISTORY_PROVIDER"
      class="org.nuxeo.elasticsearch.audit.pageprovider.ESDocumentHistoryPageProvider">
      <whereClause docType="BasicAuditSearch">
        <predicate parameter="eventDate" operator="BETWEEN">
          <field schema="basicauditsearch" name="startDate" />
          <field schema="basicauditsearch" name="endDate" />
        </predicate>
        <predicate parameter="category" operator="IN">
          <field schema="basicauditsearch" name="eventCategories" />
        </predicate>
        <predicate parameter="eventId" operator="IN">
          <field schema="basicauditsearch" name="eventIds" />
        </predicate>
        <predicate parameter="principalName" operator="IN">
          <field schema="basicauditsearch" name="principalNames" />
        </predicate>
      </whereClause>
      <sort column="eventDate" ascending="false" />
        <pageSize>10</pageSize>
        <maxPageSize>1000</maxPageSize>
    </genericPageProvider>

      <genericPageProvider name="ADMIN_HISTORY" class="org.nuxeo.elasticsearch.audit.pageprovider.ESAuditPageProvider">
        <property name="coreSession"></property>
        <property name="generateUIComments">false</property>
        <whereClause docType="BasicAuditSearch">
          <predicate parameter="eventDate" operator="BETWEEN">
            <field schema="basicauditsearch" name="startDate" />
            <field schema="basicauditsearch" name="endDate" />
          </predicate>
          <predicate parameter="category" operator="=">
            <field schema="basicauditsearch" name="eventCategory" />
          </predicate>
          <predicate parameter="eventId" operator="IN">
            <field schema="basicauditsearch" name="eventIds" />
          </predicate>
          <predicate parameter="principalName" operator="=">
            <field schema="basicauditsearch" name="principalName" />
          </predicate>
        </whereClause>
        <sort column="eventDate" ascending="false" />
        <pageSize>10</pageSize>
        <maxPageSize>1000</maxPageSize>
      </genericPageProvider>

  <genericPageProvider name="LATEST_AUDITED_CREATED_USERS_OR_GROUPS_PROVIDER"
    class="org.nuxeo.elasticsearch.audit.pageprovider.ESDocumentHistoryPageProvider">
     <pattern>
{
  "query": {
    "bool": {
      "must": [
        {
          "term": {
            "category": "userGroup"
          }
        },
        {
          "bool": {
            "should": [
              {
                "term": {
                  "eventId": "user_created"
                }
              },
              {
                "term": {
                  "eventId": "group_created"
                }
              }
            ]
          }
        }
      ]
    }
  }
}
    </pattern>
    <sort column="eventDate" ascending="false" />
    <pageSize>5</pageSize>
    <maxPageSize>100</maxPageSize>
  </genericPageProvider>

  </extension>

</component>